<head>
	<script type="text/javascript">
		var aJaxURL		= "server-side/report/undone.action.php";
		var tName	= "example";
		
		$(document).ready(function () {
			GetDate("search_start_my");
			GetDate("search_end_my");			
			LoadTable();
		});

		function LoadTable(){
			/* Table ID, aJaxURL, Action, Colum Number, Custom Request, Hidden Colum, Menu Array */
			var start	= $("#search_start_my").val();
	    	var end		= $("#search_end_my").val();
	    	var dep_id  = $("#dep_id").val();
			/* Table ID, aJaxURL, Action, Colum Number, Custom Request, Hidden Colum, Menu Array */
			GetDataTable(tName, aJaxURL, "get_list",8, "start=" + start + "&end=" + end + "&dep_id=" + dep_id, 0, "", 1, "desc");
		}

		var record;
		function play(record){
			
			link = 'http://10.0.18.18:8080/records/' + record;
			GetDialog_audio("audio_dialog", "auto", "auto","" );
			$(".ui-dialog-buttonpane").html(" ");
			$( ".ui-dialog-buttonpane" ).removeClass( "ui-widget-content ui-helper-clearfix ui-dialog-buttonpane" );
			$("#audio_dialog").html('<audio controls autoplay style="width:500px;"><source src="'+link+'" type="audio/wav"> Your browser does not support the audio element.</audio>');
            $(".download").css( "background","#408c99" );
            $(this).css( "background","#FF5555" )
            
		}
		$(document).on("change", "#search_start_my", function () {
	    	LoadTable();
	    });
	    
	    $(document).on("change", "#search_end_my", function () {
	    	LoadTable();
	    });

	    $(document).on("change", "#dep_id", function () {
	    	LoadTable();
	    });
	    
    </script>
</head>

<body>
<div id="container"style="width: 99%;">        	
<div id="dynamic">
	<h2 align="center">დაუმუშავებელი ზარები დეპარტამენტების მიხედვით</h2>
	<div id="button_area" style="margin-top: 40px;">
	<div class="left" style="width: 250px;">
    		<label for="search_start_my" class="left" style="margin: 5px 0 0 9px;">დასაწყისი</label>
    		<input style="width: 150px; margin-left: 5px; height: 18px;"  type="text" name="search_start_my" id="search_start_my" class="inpt left"/>
    	</div> 
		<div class="right" style="">
    		<label for="search_end_my" class="left" style="margin: 5px 0 0 9px;">დასასრული</label>
    		<select id="dep_id" style="margin-left: 5px;">
    		<?php 
    		require_once('includes/classes/core.php');
    		$que = mysql_query("SELECT id,`name`
                                FROM department
                                WHERE actived = 1");
    		$option = '<option value="0">ყველა</option>';
    		while ($rr = mysql_fetch_array($que)) {
    		    $option .= "<option value=\"$rr[0]\">$rr[1]</option>";
    		}
    		echo $option;
    		?>    		
    		</select>
		</div>
		<div class="right" style="">
    		<label for="search_end_my" class="left" style="margin: 5px 0 0 9px;">დასასრული</label>
    		<input style="width: 150px; margin-left: 5px; height: 18px;"  type="text" name="search_end_my" id="search_end_my" class="inpt right" />
		</div>
	</div>		
    <table class="display" id="example" style="width: 100%;">
        <thead>
            <tr id="datatable_header">
                <th>ID</th>
                <th style="width:  50%">თარიღი</th>
                <th style="width:  50%">წყარო</th>
                <th style="width:  50%">ადრესატი</th>
                <th style="width:  50%">ექსტენშენი</th>
                <th style="width:  50%">ლოდინის დრო</th>
                <th style="width:  50%">საუბრის ხანგძლივობა</th>
                <th style="width:  50%">ჩანაწერი</th>
            </tr>
        </thead>
        <thead>
            <tr class="search_header">
                <th class="colum_hidden">
                	<input type="text" name="search_id" value="ფილტრი" class="search_init" style=""/>
                </th>
                <th>
                	<input type="text" name="search_number" value="ფილტრი" class="search_init" style="width:80px;"></th>
                <th>
                    <input type="text" name="search_date" value="ფილტრი" class="search_init" style="width:80px;"/>
                </th>
                <th>
                    <input type="text" name="search_phone" value="ფილტრი" class="search_init" style="width: 80px;"/>
                </th>
                <th>
                    <input type="text" name="search_phone" value="ფილტრი" class="search_init" style="width: 80px;"/>
                </th>
                 <th>
                    <input type="text" name="search_category" value="ფილტრი" class="search_init" style="width: 80px;" />
                </th>
                 <th>
                    <input type="text" name="search_category" value="ფილტრი" class="search_init" style="width:80px;" />
                </th>
                 <th>
                    <input type="text" name="search_category" value="ფილტრი" class="search_init" style="width: 80px;" />
                </th>
            </tr>
        </thead>
    </table>
</div>
<div class="spacer">
</div>
</div>           

<!-- jQuery Dialog -->
<div id="audio_dialog" title="ჩანაწერი">
</div>
</body>